home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Lib / util / prefix.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  584 b   |  32 lines

  1. /* prefix: Determine if str1 is the prefix of str2 */
  2.  
  3. # ifndef lint
  4. static char Rcsid[] = "@(#)$Header: /xtel/pp/pp-beta/Lib/util/RCS/prefix.c,v 6.0 1991/12/18 20:25:18 jpo Rel $";
  5. # endif
  6.  
  7. /*
  8.  * $Header: /xtel/pp/pp-beta/Lib/util/RCS/prefix.c,v 6.0 1991/12/18 20:25:18 jpo Rel $
  9.  *
  10.  * $Log: prefix.c,v $
  11.  * Revision 6.0  1991/12/18  20:25:18  jpo
  12.  * Release 6.0
  13.  *
  14.  */
  15.  
  16.  
  17.  
  18. #include "util.h"
  19.  
  20. extern  char    chrcnv[];
  21.  
  22. int prefix(str1, str2)
  23. register char   *str1;
  24. register char   *str2;
  25. {
  26.     while(*str1)
  27.         if(chrcnv[*str1++] != chrcnv[*str2++])
  28.             return (FALSE);
  29.  
  30.     return (TRUE);
  31. }
  32.